/**堆对象先进先出 */
class Heap {
    private readonly heapArr: Array<(...args: any) => void>
    constructor() {
        this.heapArr = new Array();
    }
    InFun(item: (...args: any) => void) {
        this.heapArr.push(item)
    }
    Next(...args: any[]) {
        if (this.heapArr.shift() !== undefined) {
            const fun = this.heapArr.shift();
            fun!(...args);
        }
    }
}

/**登录静态工具堆 */
class LoginCall {
    private static heap: Heap;
    static initHeap() {
        if (this.heap !== null) {
            this.heap = new Heap();
        }
        return this.heap;
    }
    static get I() {
        this.initHeap();
        return this.heap;
    }
}

export { LoginCall };